package com.lebang.service.buss;

import com.lebang.entity.LbbAppVersion;
import com.lebang.example.LbbAppVersionExample;
import com.lebang.mapper.LbbAppVersionMapper;
import com.lebang.model.vo.buss.AppVersionVo;
import com.lebang.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 应用版本
 * @className AppStoreService
 * @author weizx  
 * @date 2018年7月17日 下午6:24:50
 */
@Service
public class AppVersionService   extends BaseService<LbbAppVersion,Integer, LbbAppVersionExample>{

	@Autowired
	private LbbAppVersionMapper lbbAppVersionMapper;


	
	public Map<String, Object> pagging(AppVersionVo vo) {
		Integer total = lbbAppVersionMapper.total(vo);
		List<Map<String, Object>> rows = lbbAppVersionMapper.pagging(vo);
		Map<String, Object> data = new LinkedHashMap<>();
		data.put("total", total);
		data.put("rows", rows);
		return data;
	}


	 public int update(LbbAppVersion av) {
		 return lbbAppVersionMapper.updateByPrimaryKeySelective(av);
	}

	public int delete(LbbAppVersion av) {
		av.setHasDeleted("True");
		return lbbAppVersionMapper.updateByPrimaryKeySelective(av);

		
	}

	public LbbAppVersion getByInnerCodeAndappStore(String innerCode, String appStore) {
		return lbbAppVersionMapper.getByInnerCodeAndappStore(innerCode,appStore);
	}

	public int insertSelective(LbbAppVersion version) {
		return lbbAppVersionMapper.insertSelective(version);
	}

	public int updateByPrimaryKeySelective(LbbAppVersion version) {
		return lbbAppVersionMapper.updateByPrimaryKeySelective(version);
	}

	public LbbAppVersion getByInnerCodeAndappStoreAndAppId(Integer innerCode, String appStore,String appId){
		return lbbAppVersionMapper.getByInnerCodeAndappStoreAndAppId(innerCode,appStore,appId);
	}
}
